import java.util.StringTokenizer;


public class StrTokDemo2 {

  public static void main(String[] args) {

    String a = "Java is a|great!language";
    StringTokenizer st = new StringTokenizer(a, " !|");
    while(st.hasMoreElements())
      System.out.println("Element: " + st.nextElement());
  }
}
